package nuc.lizongze.backend.service.impl;

import nuc.lizongze.backend.feign.CommonItemFeignClient;
import nuc.lizongze.backend.service.ItemCategoryService;
import nuc.lizongze.pojo.TbItemCat;
import nuc.lizongze.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ItemCategoryServiceImpl implements ItemCategoryService {
    @Autowired
    CommonItemFeignClient commonItemFeignClient;
    @Override
    public Result selectItemCategoryByParentId(Long id) {
        List<TbItemCat> tbItemCats = commonItemFeignClient.selectItemCategoryByParentId(id);
        if(tbItemCats != null && tbItemCats.size() > 0){
            return Result.ok(tbItemCats);
        }
        return Result.error("查无此结果");
    }
}
